/* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
 * Copyright 2008-2010 Pelican Mapping
 * http://osgearth.org
 *
 * osgEarth is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 */
#ifndef OSGEARTHUTIL_NEAR_FAR_GROUP_H
#define OSGEARTHUTIL_NEAR_FAR_GROUP_H

#include <VBF_3DMap/VBF_EarthUtil/Common>
#include <VBF_Engine/VBF_SceneGraph/VBF_Camera.h>

namespace osgEarth { namespace Util
{
    using namespace osgEarth;

    /**
     * A NearFarGroup is a container for objects that should generate a
     * "self-contained" near/far clip plane calculation. The near/far clip
     * calculation for this group exists independently of the rest of the
     * scene graph.
     *
     * This is useful for creating more than one "depth domains" within the
     * scene. For example, if you have the globe in the background, but at the 
     * same time you want to zoom up very close to an aircraft, a combined
     * clip plane domain may not have sufficient precision. Placing the
     * aircraft under a NearFarGroup can help mitigate this problem.
     */
    class OSGEARTHUTIL_EXPORT NearFarGroup : public osg::Camera
    {
    public:
        NearFarGroup();

    public:
        virtual void traverse(osg::NodeVisitor& nv);
    };

} } // namespace osgEarth::Util

#endif // OSGEARTHUTIL_NEAR_FAR_GROUP_H
